<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <h2>二级页面 -- <span id="span"></span></h2>

  <!-- <script>
    window.onmessage = function(e) {
      
      console.log(`一级页面传递过来的消息是：${e.data}`)
      document.getElementById('span').innerHTML = e.data

      const {age} = JSON.parse(e.data)
      setTimeout(() => {
        e.source.postMessage(`成哥现在${age}岁了`, e.origin)
      }, 3000)
    }
  </script> -->

  <script>
    document.domain = '127.0.0.1'
    var data = '二级页面的数据'
  </script>
</body>
</html>